home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tspa3155.zip / TSUNTJ.INT < prev    next >
Text File  |  1992-11-07  |  4KB  |  111 lines

  1. {$B-,D-,F-,I+,N-,R-,S+,V+}
  2.  
  3. (*
  4. Timo Salmi UNiT J
  5. A Turbo Pascal unit of file information and handling etc
  6. All rights reserved 24-Nov-81, 6-Dec-92, 19-Aug-92, 7-Nov-92
  7.  
  8. In the 24-Nov-91 update of USUNTH unit part of its routines were
  9. transferred here to TSUTNTJ. The transferred routines were
  10.   COPYFILE Copy a file from within a Turbo Pascal program
  11.   ISDIRFN  Is a name a directory or not
  12.   OPENEDFN Is an assigned textfile still open or not
  13.   PIPEDIFN Is the standard input from redirection
  14.   PIPEDNFN Is the standard output redirected to nul
  15.   PIPEDOFN Is the standard output redirected
  16.  
  17. This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
  18. NON-INSTITUTIONAL purposes, provided it is not changed in any way. For
  19. ANY other usage, such as use in a business enterprise or a university,
  20. contact the author for the terms of registration.
  21.  
  22. The units are under development. Comments and contacts are solicited. If
  23. you have any questions, please do not hesitate to use electronic mail for
  24. communication.
  25. InterNet address: ts@uwasa.fi            (preferred)
  26. Bitnet address:   SALMI@FINFUN.BITNET
  27.  
  28. The author shall not be liable to the user for any direct, indirect or
  29. consequential loss arising from the use of, or inability to use, any unit,
  30. program or file howsoever caused. No warranty is given that the units and
  31. programs will work under all circumstances.
  32.  
  33. Timo Salmi
  34. Professor of Accounting and Business Finance
  35. Faculty of Accounting & Industrial Management; University of Vaasa
  36. P.O. BOX 297, SF-65101 Vaasa, Finland
  37. *)
  38.  
  39. unit TSUNTJ;
  40.  
  41. (* ======================================================================= *)
  42.                           interface
  43. (* ======================================================================= *)
  44.  
  45. uses Dos;
  46.  
  47. (* ====================================================================
  48.                    File status information
  49.    ==================================================================== *)
  50.  
  51. (* This function returns whether a name is a directory or not.
  52.    Avoid using this on an open file or standard devices. *)
  53. function ISDIRFN (name : string) : boolean;
  54.  
  55. (* This function returns whether a name is a directory or not.
  56.    Avoid using this on an open file or standard devices.
  57.    An alternative method *)
  58. function ISDIR2FN (name : string) : boolean;
  59.  
  60. (* This function returns whether a text file is open or closed.
  61.                                    ^^^^
  62.    Naturally the FilePointer must have been assigned at an earlier stage.
  63.    Very convenient as a test in routines which close a file.
  64.    e.g. use: if OPENEDFN(f) then close(f);                                *)
  65. function OPENEDFN (var FilePointer : text) : boolean;
  66.  
  67. (* Is the standard input from redirection. Based on PC-Mag Vol 10 No 7, 374,
  68.    Duncan 412, Dettmann 602-603 *)
  69. function PIPEDIFN : boolean;
  70.  
  71. (* Is the standard output redirected. Based on PC-Mag Vol 10 No 7, 374,
  72.    Duncan 412, Dettmann 602-603 *)
  73. function PIPEDOFN : boolean;
  74.  
  75. (* Is the standard output redirected to nul. Based on PC-Mag Vol 10 No 7, 374,
  76.    Duncan 412, Dettmann 602-603 *)
  77. function PIPEDNFN : boolean;
  78.  
  79. (* ====================================================================
  80.                    Program information
  81.    ==================================================================== *)
  82.  
  83. (* Show the memory address where the interrupt is located *)
  84. procedure INTRLOCA (IntrNumber  : byte;
  85.                     var segment : word;
  86.                     var offset  : word);
  87.  
  88. (* Show the memory address to which the interrupt points *)
  89. procedure INTRADDR (IntrNumber  : byte;
  90.                     var segment : word;
  91.                     var offset  : word);
  92.  
  93. (* ====================================================================
  94.                       Perform tasks
  95.    ==================================================================== *)
  96.  
  97. (* Copy a file (of any type)
  98.    Status codes:
  99.    0 : ok
  100.    1 : FromFile does not exits
  101.    2 : ToFile already exists
  102.    3 : ToFile cannot be opened for writing (read-only,
  103.          write protected, invalid device)
  104.    4 : Error in writing to ToFile
  105.    5 : Copy error (disk probably full)
  106.    6 : Date stamp error
  107.    7 : Out of memory
  108. *)
  109. procedure COPYFILE (FromFile, ToFile : string; var status : byte);
  110.  
  111.